home *** CD-ROM | disk | FTP | other *** search
/ Experimental BBS Explossion 3 / Experimental BBS Explossion III.iso / graphics / scrfe100.zip / FONTOOLS.H < prev    next >
C/C++ Source or Header  |  1993-02-27  |  3KB  |  74 lines

  1. /* Fontools header file (C) 1993 Jeremy Lilley
  2.  
  3.  Use this file to interface various SFF and SFS files with the C language.
  4.  Depending on your memory model, you may have to use FONTS_N.OBJ (near) or 
  5.  FONTS_F.OBJ (far). Both are designed for 32-bit far pointers, and if you 
  6.  wish to use 16 bit pointers (tiny or small memory model), you must modify
  7.  the FONTS_N.ASM file as directed in the file and reassemble it with MASM.
  8.  
  9.  You can interface files either of the following ways:
  10.  
  11.      1) Create an OBJ file with either BINOBJ (from Borland) and link it
  12.         to your file as data, and call the necessary procedures.
  13.         
  14.      2) Use LANGUAGE.EXE to make a C header file with the data from 
  15.         a SFF or SFS file and use the INCLUDE directive to make it
  16.         data.
  17.         
  18.      3) Store the images in disk files are retrieve them using file IO.
  19.         Allocate pointers, etc. This is not very efficient and can leave
  20.         a bunch of small stupid 1 to 4 k font and screen files lying around
  21.         uncompressed. These files also have a tendency to get "lost."
  22.                 
  23.  Here is an example (using #2, but #1 is similar) :
  24.  
  25.  #include <stdio.h>
  26.  #include "fontools.h"
  27.  #include "mydata_s.h"
  28.  #include "mydata_f.h"
  29.  
  30.  / *   mydata_s contains the screen, mydata_f contains the font. The
  31.    indentifiers are mydatascreen and mydatafont. * /
  32.    
  33.  main () {
  34.  readfont ( mydatafont );
  35.  readscreen ( mydatascreen );
  36.  }
  37.  
  38. */
  39.  
  40. /* The following are the declarations and comments about them. Depending on
  41.  the memory model, you may have to change them. */
  42.  
  43. extern void readfont( char far *fontptr );
  44. /* This function reads a font file that has been stored in memory by any
  45.  method. It check for font file validity before attempting to display it. */
  46.  
  47. extern void readscreen( char far *screenptr );
  48. /* This function reads a screen file or block from memory stored by any 
  49.   method. It uses the dimensions given when it was saved. */
  50.  
  51. extern void sequencefonts (void);
  52. /* BE CAREFUL WITH THIS! If you can help it, don't call it yourself.
  53.  It sets up the EGA card so that you can move fonts into the 0xA000 segment.
  54.  Each character occupies 32 bytes regardless of the number of points per
  55.  character needed. Thus, character 0 would be at 0xA000:0, character 1 would
  56.  be at 0xA000:0x20, etc. DON'T LEAVE THIS ON WHEN YOU DON'T HAVE TO BECAUSE
  57.  IT SCREWS UP THE WAY THE SCREEN LOOKS WHEN IT IS ON (to say the least!). */
  58.  
  59. extern void desequencefonts (void);
  60. /* Use this to turn off sequencefonts and normalize the display. */
  61.  
  62. extern void resetfonts (void);
  63. /* This preforms a mode set and sets th lines to 400 on VGA.  */
  64.  
  65. extern void savefonts( char far *savebufferpointer );
  66. /* Saves fonts to a 8192-byte buffer */
  67.  
  68. extern void restorefonts( char far *restorebufferpointer );
  69. /* Restores fonts from a 8192-byte buffer */
  70.  
  71. extern void setscanlines( char scanlines );
  72. /* Sets the scan lines on VGA to:
  73.      0=200 lines, 1=350 lines, 2=400 lines */
  74.